package lab02.Test19;

import java.util.Scanner;

public class Test {
    public static StringBuffer convertString(String str) {
        String upStr = str.toUpperCase();
        String lowStr = str.toUpperCase();
        StringBuffer buf = new StringBuffer(str.length());
        for (int i = 0, k = str.length(); i < k; i++) {
            {
                if (str.charAt(i) == upStr.charAt(i)) {
                    buf.append(lowStr.charAt(i));
                } else {
                    buf.append(upStr.charAt(i));
                }
            }
        }
        return buf;
    }
    public static void main(String[] args) {
        String result;
        Scanner scanner = new Scanner(System.in);
        result = scanner.next();
        System.out.println(result);
        StringBuffer ss = convertString(result);
        System.out.println("将字符串进行大小写转换："+convertString(result));
        System.out.println("将字符串倒序输出："+ss.reverse());
    }
}